<?php use_helper('Date') ?>
<?php use_helper('LetsManager'); ?>

<h2>Liste des offres <?php if($keySearch != null){ echo " comportant '".$keySearch."'"; }?></h2>

  <form action="<?php echo url_for('@lets_user_offers_list') ?>" method="post">
	<?php echo $searchForm; ?>
    <input type="submit" name="submit" value="Filtrer" class="small blue button" />
  </form>

<br/>

<table style="width:95%" class="datalist">
    <thead >
        <tr>
      <th width="20%">Adhérent</th>
      <th width="12%">Catégorie</th>
      <th>Description</th>
      <th width="10%">Créé le</th>
      <?php if($canManageOffers): ?>
        <th width="5%">Actions</th>
      <?php endif ?>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($offersPager as $offer): ?>
            <?php include_partial('rowTable', array('offer' => $offer, 'canManageOffers' => $canManageOffers)) ?>
        <?php endforeach ?>
        <?php if (count($offersPager) == 0): ?>
          <tr><td colspan="3">Aucune offre dans cette catégorie</td></tr>
        <?php endif ?>
    </tbody>
</table>
<?php include_partial('global/pager', array('pager' => $offersPager, 'route' => '@lets_user_offers_list', 'params' => array('category_id' => $category_id))) ?>
<br/>
<?php echo link_to("Toutes les offres et demandes en PDF",'@lets_allAsksOffers_export_pdf',array('popup'=>true,'class'=>'blue button')) ?>